package mijia

import (
	"fmt"
	af "learning/gooop/creational_patterns/abstract_factory"
)

type tMijiaLight struct {
	af.DeviceInfo
	iMode int
}


func newMijiaLight(info *af.DeviceInfo) *tMijiaLight {
	return &tMijiaLight{
		*info, 0,
	}
}

func (me *tMijiaLight) Open() error {
	fmt.Printf("tMijiaLight.Open, %v\n", &me.DeviceInfo)
	return nil
}

func (me *tMijiaLight) Close() error {
	fmt.Printf("tMijiaLight.Close, %v\n", &me.DeviceInfo)
	return nil
}

func (me *tMijiaLight) GetLightMode() (error, int) {
	fmt.Printf("tMijiaLight.GetLightMode, %v\n", me.iMode)
	return nil, me.iMode
}

func (me *tMijiaLight) SetLightMode(mode int) error {
	fmt.Printf("tMijiaLight.SetLightMode, %v\n", mode)
	me.iMode = mode
	return nil
}